﻿namespace AntdUI.Demo
{
    public partial class Form1 : AntdUI.Window
    {
        public Form1()
        {
            InitializeComponent();
        }

        private void Form1_Load(object sender, System.EventArgs e)
        {
        }

        private void Form1_Shown(object sender, System.EventArgs e)
        {
            select1.Focus();

        }

        private void toolStripButton2_Click(object sender, System.EventArgs e)
        {
            int _curIdx = select1.SelectedIndex;

            if (_curIdx == select1.Items.Count - 1)
            {
                AntdUI.Message.warn(this, "已经到底了！", Font, 2);
                return;
            }

            select1.SelectedIndex = ++_curIdx;
        }

        private void toolStripButton1_Click(object sender, System.EventArgs e)
        {
            int _curIdx = select1.SelectedIndex;

            if (_curIdx == 0)
            {
                AntdUI.Message.warn(this, "已经到顶了！", Font, 2);
                return;
            }

            select1.SelectedIndex = --_curIdx;
        }
    }
}